import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# 1.打开浏览器
from selenium.webdriver.common.keys import Keys
# 创建浏览器对象
driver = webdriver.Chrome()
# 2.输入访问地址（URL）
url = r"E:\python_test\ui自动化测试\注册实例.html"
driver.get(url)
# 放大浏览器页面
driver.maximize_window()
# 暂停2秒
time.sleep(2)

# 1. 填写主页面的注册信息
# 用户名
driver.find_element(By.CSS_SELECTOR, "#user").send_keys("admin")
# 密码
driver.find_element(By.CSS_SELECTOR, "#password").send_keys("123456")
# 电话
driver.find_element(By.CSS_SELECTOR, "#tel").send_keys("13466666666")
# 邮箱
driver.find_element(By.CSS_SELECTOR, "#email").send_keys("10086@qq.com")
# 暂停2秒
time.sleep(2)


# 切换到注册页面A

# 1. 填写注册页面A的注册信息
driver.find_element(By.CSS_SELECTOR, "#ZCA").click()
# 用户名
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")
# 密码
driver.find_element(By.CSS_SELECTOR, "#passwordA").send_keys("123456")
# 电话
driver.find_element(By.CSS_SELECTOR, "#telA").send_keys("13466666666")
# 邮箱
driver.find_element(By.CSS_SELECTOR, "#emailA").send_keys("10086@qq.com")
# 暂停2秒
time.sleep(2)